package com.example.videolib

import android.content.pm.ActivityInfo
import android.content.res.Configuration
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import androidx.navigation.NavController
import androidx.navigation.Navigation
import com.alibaba.android.arouter.facade.annotation.Route
import com.example.baselib.activity.BaseViewModelActivity
import com.example.baselib.constants.ARConstants

@Route(path = ARConstants.APP_VIDEO)
class VideoMainActivity : BaseViewModelActivity<VideoViewModel>() {
    private val findNavController: NavController by lazy { Navigation.findNavController(this, R.id.video_nav_fragment) }
    override fun providerVMClass(): Class<VideoViewModel>? =VideoViewModel::class.java

    override fun layoutResId(): Int =R.layout.activity_video_main

    override fun initView() {
        findNavController.addOnDestinationChangedListener { controller, destination, arguments ->
            when(destination.id){
                R.id.videoMainFragment -> {
                    requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
                    setShowStatus(true)
                    setShowToolbar(true)
                    setToolbarMsg("工业视频")
                    setToolbarColor(R.color.colorDBlue, R.color.colorWhite)
                    setToolbarMenu(true, R.id.menu_video)

                }
                else -> {
                    requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
                    setShowStatus(false)
                    setShowToolbar(false)
                }
            }
        }

    }

    override fun initData() {

    }

}
